package com.erp.erp_servers.money.imp;

import com.erp.erp_dao.money.IReceivePaymentRefundDao;
import com.erp.erp_entitys.money.entity.ReceivePaymentRefundEntity;
import com.erp.erp_servers.money.IReceivePaymentRefundService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @ClassName : ReceivePaymentRefundServiceImp
 * @Description : 资金管理-收款-退款实现类
 * @Author : lst
 * @Date: 2020-12-07 21:36
 */
@Service
public class ReceivePaymentRefundServiceImp implements IReceivePaymentRefundService {

    /**
     * 注入退款mapper
     */
    private final IReceivePaymentRefundDao receivePaymentRefundDao;

    @Autowired
    public ReceivePaymentRefundServiceImp(IReceivePaymentRefundDao receivePaymentRefundDao) {
        this.receivePaymentRefundDao = receivePaymentRefundDao;
    }

    /**
     * 通过ID查询单条数据
     *
     * @param id 主键
     * @return 实例对象
     */
    @Override
    public ReceivePaymentRefundEntity queryById(Integer id) {
        return receivePaymentRefundDao.queryById(id);
    }

    /**
     * 通过实体作为筛选条件查询
     *
     * @param receivePaymentRefund 实例对象
     * @return 对象列表
     */
    @Override
    public List<ReceivePaymentRefundEntity> queryAll(ReceivePaymentRefundEntity receivePaymentRefund) {
        return receivePaymentRefundDao.queryAll(receivePaymentRefund);
    }

    /**
     * 新增数据
     *
     * @param receivePaymentRefund 实例对象
     * @return 影响行数
     */
    @Override
    public int insert(ReceivePaymentRefundEntity receivePaymentRefund) {
        return receivePaymentRefundDao.insert(receivePaymentRefund);
    }

    /**
     * 详情批量新增
     * @param list 新增对象集合
     * @return 影响行数
     */
    @Override
    public int addList(List<ReceivePaymentRefundEntity> list) {
        return receivePaymentRefundDao.addList(list);
    }

    /**
     * 修改数据
     *
     * @param receivePaymentRefund 实例对象
     * @return 影响行数
     */
    @Override
    public int update(ReceivePaymentRefundEntity receivePaymentRefund) {
        return receivePaymentRefundDao.update(receivePaymentRefund);
    }
}
